package com.zb.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.zb.mapper.ViewNetworkEmpAccountMapper;
import com.zb.service.ViewNetworkEmpAccountService;
import com.zb.view.ViewNetworkEmpAccount;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/11/4 0004
 **/
@Service
public class ViewNetworkEmpAccountServiceImpl implements ViewNetworkEmpAccountService {
    @Resource
    private ViewNetworkEmpAccountMapper viewNetworkEmpAccountMapper;

    // 根据人员ID获取人员账号信息
    @Override
    public ViewNetworkEmpAccount getById(Long id) {
        return viewNetworkEmpAccountMapper.getById(id);
    }

    // 根据人员ID获取人员账号信息
    @Override
    public List<ViewNetworkEmpAccount> getByIds(List<Long> ids) {
        if (CollectionUtil.isEmpty(ids)) {
            return new ArrayList<>();
        }
        return viewNetworkEmpAccountMapper.getByIds(ids);
    }

    // 根据手机号查询服务人员山账号信息
    @Override
    public ViewNetworkEmpAccount getByPhone(String phone) {
        return viewNetworkEmpAccountMapper.getByPhone(phone);
    }
}
